
//
// Store all of the Broadcast Navigation data for a particular satellite 
//

// Only create a new class when a satelite is observed for the first time
public class NavDataGlonass {

    NavDataGlonass (int PRN, double time) {
        prn = PRN;
        toc = time;
        //System.out.println("Created NavDataGlonass for :"+prn+" "+time);
    }

    /**
      * PRN / EPOCH / SV CLK
      * prn satellite PRN number
      * toc Time of Clock        (seconds)
      * clockBias 
      * relativeFreqBias
      * messageFrameTime
    */
    private int prn;
    private double toc; 
    private double clockBias;
    private double relativeFreqBias;
    private double messageFrameTime;
    
    // PRN and TOC are set in the constructor
    public void setClockBias(double val)        { clockBias = val;} 
    public void setRelativeFreqBias(double val) { relativeFreqBias = val;}
    public void setMessageFrameTime(double val) { messageFrameTime = val;}

    public int prn() { return prn;}
    public double toc() { return toc;}
    public double clockBias() { return clockBias;} 
    public double relativeFreqBias() { return relativeFreqBias;}
    public double messageFrameTime() { return messageFrameTime;}

    /**
      * First Frame Variable from Ephemeris
      * SatX                         (km)
      * VelX                         (km/sec) 
      * AccX                         (km/sec2)
      * health                       (0=OK)
    */
    private double satX;
    private double velX;
    private double accX;
    private double health;

    public void setSatX( double val ) { satX = val; }
    public void setVelX( double val ) { velX = val; }
    public void setAccX( double val ) { accX = val; }
    public void setHealth( double val ) { health = val;}
    public double satX() { return satX; }
    public double velX() { return velX; }
    public double accX() { return accX;}
    public double health() { return health; }

    /**
      * Second Frame Variable from Ephemeris
      * satY                         (km)
      * velY                         (km/sec) 
      * accY                         (km/sec2)
      * freqNo                       (-7 to 13)
    */
    private double satY;
    private double velY;
    private double accY;
    private double freqNo;

    public void setSatY( double val ) { satY = val; }
    public void setVelY( double val ) { velY = val; }
    public void setAccY( double val ) { accY = val; }
    public void setFreqNo( double val ) { freqNo = val;}
    public double satY() { return satY; }
    public double velY() { return velY; }
    public double accY() { return accY;}
    public double freqNo() { return freqNo; }

    /**
      * Third Frame Variable from Ephemeris
      * satZ Issue Date of Ephemeris (km)
      * velZ                         (km/sec) 
      * accZ                         (km/sec2)
      * ageOfOp (Age of Operation)   (days)
    */
    private double satZ;
    private double velZ;
    private double accZ;
    private double ageOfOp;

    public void setSatZ( double val ) { satZ = val; }
    public void setVelZ( double val ) { velZ = val; }
    public void setAccZ( double val ) { accZ = val; }
    public void setAgeOfOp( double val ) { ageOfOp = val;}
    public double satZ() { return satZ; }
    public double velZ() { return velZ; }
    public double accZ() { return accZ;}
    public double ageOfOp() { return ageOfOp; }

}
